<template>
    <div class="hd-btton">
        <a class="btn" href="javascript: void(0);" @click="action()">
            <div class="btn-bg" />
            <div class="btn-label">{{ airs }}</div>
            <div class="btn-icon">
                <i class="iconfont icon icon-jiantou2" />
            </div>
        </a>
    </div>
</template>

<script>
export default {
    name: 'ButtonHover',
    props: {
        airs: {
            type: String,
            default: '查看全部'
        },
        from: {
            type: String,
            default: '#6CD4FF'
        },
        to: {
            type: String,
            default: '#0394FF'
        }
    },
    methods: {
        action() {
            this.$emit('action')
        }
    }
}
</script>

<style lang="less" scoped>
.hd-btton {
    display: inline-block;
    line-height: 40px;
    overflow: hidden;
    border: 1px solid rgba(3, 148, 255, 1);
    position: relative;
    box-shadow: 0 6px 6px 0 rgba(10, 88, 244, 0.15);
    cursor: pointer;
    &:hover {
        .btn-bg {
            right: -10px;
            background: #fff;
        }
        .btn-icon {
            color: #20a0ff !important;
        }
        .btn-label {
            color: #20a0ff;
        }
    }
    .btn-bg {
        position: absolute;
        left: -15px;
        right: 40px;
        top: -20px;
        bottom: -20px;
        transition: 0.3s all;
        transform: rotate(8deg);
        background: linear-gradient(
            180deg,
            rgba(108, 212, 255, 1) 0%,
            rgba(3, 148, 255, 1) 100%
        );
    }
    .btn-label {
        color: #fff;
        float: left;
        position: relative;
        z-index: 2;
        padding: 0 25px;
        text-transform: uppercase;
        font-size: 12px;
        letter-spacing: 1px;
    }
    .btn-icon {
        float: left;
        width: 36px;
        z-index: 2;
        position: relative;
        height: 40px;
        color: #fff;
        transition: 0.3s all;
        text-align: center;
        .icon-jiantou2 {
            font-size: 12px;
        }
    }
}
</style>
